package sys.interaction;

import sys.person.AbstractPerson;
import sys.person.Player;
import sys.ui.MainMenu;
import sys.ui.PlayerMenu;

import java.util.Scanner;

import static sys.interaction.IteracMain.interMain;

public class IteracPlayer {

    static int select;
    public static void interPlayer() {

        Scanner input = new Scanner(System.in);
        String id;

        System.out.print("请输入你的学号：");
        id = input.next();

        while (true) {
            PlayerMenu.display();
            select = input.nextInt();
            switch (select) {
                case 1 : {
                    AbstractPerson.browseEvent();
                    break;
                }
                case 2 : {
                    new Player(id).checkMyEvent();
                    break;
                }
                case 3 : {
                    new Player(id).checkMyEvent();
                    System.out.print("请输入你要查询的项目编号： ");
                    String eventID = input.next();
                    new Player(id).checkMyRankOfEvent(eventID);
                    break;
                }
                case 0 : {
                    interMain();
                    break;
                }
                default: {
                    System.out.print("请重新输入： ");
                }
            }
        }

    }
}
